package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.CommentQuery;
import cn.wolfcode.trip.base.query.StrategyCommentQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyComment entity);

    StrategyComment selectByPrimaryKey(Long id);

    List<StrategyComment> selectAll();

    int updateByPrimaryKey(StrategyComment entity);

    /**
     *根据大攻略id查出该攻略所有的点评
     * @param qo
     * @return
     */
    List<StrategyComment> selectForList(StrategyCommentQuery qo);

    /**
     * 根据点评id和标签id保存点评和标签的关系
     * @param cId
     * @param tId
     */
    void insertRelation(@Param("cId") Long cId, @Param("tId") Long tId);

    /**lituan
     * 查出所有状态为热门的点评
     * @param state
     * @return
     */
    List<StrategyComment> selectHotComment(Long state);

    void update(StrategyComment strategyComment);

    List<StrategyComment> selectComment(CommentQuery qo);
}